const BaseRest = require('../rest.js');
const axioss = require('../../utils/axios-stock')

module.exports = class extends BaseRest {
  async getAction() {
    if(this.id === 'now_index'){
      // console.log('ENV', this.ctx.config('stockURL'))
      let res = await axioss.get('/now_index')
      // console.log('data', res.data)
      this.ctx.body = {
        code: 0,
        data: res.data
      }
      return
    }
    if(this.id === 'more_index'){
      // console.log('ENV', this.ctx.config('stockURL'))
      let res = await axioss.get('/stock_index')
      // console.log('data', res.data)
      this.ctx.body = {
        code: 0,
        data: res.data
      }
      return
    }
  }
};
